<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/8/10 0010
 * Time: 10:36
 */
namespace Common\Model;
use Common\Model\CommonModel;
class MessageModel extends CommonModel{

    protected $_validate = array(
        //array(验证字段,验证规则,错误提示,验证条件,附加规则,验证时间)
        array('title', 'require', '通知标题不能为空！', 1, 'regex', CommonModel:: MODEL_BOTH  ),
        array('content', 'require', '通知正文不能为空！', 1, 'regex', CommonModel:: MODEL_BOTH  ),
    );

    protected $_auto = array(
        array('send_time','mDate',1,'callback'),
    );

    function mDate(){
        return date("Y-m-d H:i:s");
    }
}